home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / enhance / sweptsph.doc < prev    next >
Text File  |  1994-08-09  |  4KB  |  99 lines

  1.  
  2.  
  3. Syntax:
  4.     sweptsph SweptSphCenter SweptSphRadius
  5.  
  6.  
  7.     SweptSphCenter
  8.  
  9.         bezier x0 y0 z0  x1 y1 z1  x2 y2 z2  x3 y3 z3
  10.         coeffs x0 x1 x2 x3  y0 y1 y2 y3  z0 z1 z2 z3
  11.  
  12.         xbezier x0 x1 x2 x3
  13.         ybezier y0 y1 y2 y3
  14.         zbezier z0 z1 z2 z3
  15.  
  16.         xcoeffs x0 x1 x2 x3
  17.         ycoeffs y0 y1 y2 y3
  18.         zcoeffs z0 z1 z2 z3
  19.  
  20.  
  21.     SweptSphRadius
  22.  
  23.         r0 r1 r2 r3
  24.  
  25.  
  26.     Examples:
  27.  
  28.         sweptsph bezier  -10 0 0  -10 0 10  10 0 -10  10 0 0
  29.             1 0 0 0
  30.  
  31.         sweptsph coeffs  .65 15.7 -22.2 0  0 0 0 0   1 56 -110 65.5
  32.             1 -1 0 0
  33.  
  34.         sweptsph 
  35.             xbezier 0 10 -10 0
  36.             ycoeffs 0 10 -10 0
  37.             zbezier 10 0 0 -10
  38.             .5 6 -6 0
  39.  
  40.     This primitive is defined as a sphere of varying radius swept, or
  41. extruded along a path in space.  The path is defined in one of several ways.
  42. The path can either be defined as four points which define a bezier path, where
  43. the path passes through the first and last endpoints with the second and third
  44. points defining the slope or tangent line for the curve at the first and last
  45. points.  This is specified as "bezier p1 p2 p3 p4" where pn is an x,y,z
  46. triplet.
  47.     A second way to define the curve is to specify the coeffecients for
  48. the parametric equations that define the curve. This is specified as 
  49. "coeffs fx fy fz" where each fn is a third order equation, c0 c1 c2 c3, where
  50. fn = c0 + c1*x + c2*x^2 + c3*x^3.
  51.     A third way is to use any combination of parametric bezier curves
  52. or function coeffs.  These are specified as "nbezier" or "ncoeffs" where n
  53. is x, y, or z.  These are followed by four numbers that are interpreted as
  54. the coeffecients for the parametric variable x, y, or z in the case of
  55. "ncoeffs" or as the bezier curve where the first number is the starting
  56. value, the last value is the ending value, and the second and third values
  57. define the "speed" at which the curve leaves the endpoints.
  58.  
  59.     The radius is specifed as four numbers which are the coefficients for
  60. a third order equation over the interval [0,1].  This is specified as 
  61. "c0 c1 c2 c3" where r(x) = c0 + c1*x + c2*x^2 + c3*x^3.
  62.  
  63.     Both the radius and the center equations are evaluated on the interval
  64. [0,1].
  65.  
  66.  
  67.     KNOWN BUGS:
  68.  
  69.     There are a few known bugs:
  70.  
  71.     1) Often there is a "shadow" ring around the diameter of the primitive
  72. where the functions are evaluated at t = 0.5.  Presumably this is due to
  73. roundoff error possibly in the root finding algorithms, perhaps elsewhere.
  74.  
  75.     2) Some configurations using the "bezier" specification result in
  76. garbage.  Usually this can be avoided by changing the defining point's values
  77. slightly without affecting the curve noticeably.  Examples are "bezier -10 0 0
  78. -10 0 0  10 0 0  10 0 0" and "bezier -10 0 0  10 0 10  -10 0 10  10 0 0".
  79.  
  80.  
  81.     OTHER PROBLEMS:
  82.  
  83.     Using third order equations to define the center path or the radius
  84. requires solving a tenth order equation when checking for intersection.  All
  85. roots over the interval (0,1) must be found, not just the smallest.  The root
  86. finder used was one that I wrote that uses a combination of Newton-Rasphson and
  87. bisection.  It ends up being fairly slow and probably could use some speeding
  88. up.  A few possibilities would be using Sturm sequences to find the number
  89. of roots over an interval (I tried this but my algorithm did not find all the
  90. roots and thus produced gaps in the surface.  I plan on trying to fix it if I
  91. can.) and to reduce the polynomial by deviding through by known roots before
  92. solving for remaining roots.
  93.  
  94.     Any comments, bug reports, or suggestions for changes or improvements
  95. will be greatly appreciated.
  96.  
  97.     ---Larry Coffin
  98.         lcoffin@clciris.chem.umr.edu
  99.